package cn.js.ccit.flowersmall.order;

import io.micrometer.core.instrument.MeterRegistry;
import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
@EnableAutoDataSourceProxy
@EnableFeignClients
// 开启资源服务器
@EnableResourceServer
// 开启服务发现
@EnableDiscoveryClient
@MapperScan("cn.js.ccit.flowersmall.order.mapper")
@SpringBootApplication
public class FlowersmallOrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(FlowersmallOrderApplication.class,args);
    }
    // 监控JVM指标
    @Bean
    MeterRegistryCustomizer<MeterRegistry> configurer(
            @Value("${spring.application.name}") String applicationName
    ){
        return registry -> registry.config().commonTags("application", applicationName);
    }
}
